#ifndef PLAYER_H_INCLUDED
#define PLAYER_H_INCLUDED

/*
* Copyright (c) 2010 Michael Collins
*
* This file is part of TerraFirma.
*
* TerraFirma is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* TerraFirma is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with TerraFirma.  If not, see <http://www.gnu.org/licenses/>.
*/
#include "lua.hpp"
#include <stdint.h>
#include <vector>

namespace game
{

    class Player
    {
    public:
        char name [64];
        uint8_t id, host_id, team;
        uint16_t ping;
        int16_t score; //Game uses this however it wants
        uint32_t vehicle; //Entity that is the current avatar for the player
        bool alive;

        //registers the static C methods below to the prototype player object in lua
        static void RegisterFunctions(lua_State *L);

    private:
        //C functions to call from lua. DONT CALL THESE FROM C!!
        static int Leave(lua_State* L);
        static int SayAll(lua_State* L);
        static int SayTeam(lua_State* L);
        static int SayPlayer(lua_State* L);
        static int GetPlayerID(lua_State* L);
        static int GetPlayerByID(lua_State* L);
    };

    //static Player& get_by_id(uint8_t id);
    static std::vector<Player> players;
}


#endif // PLAYER_H_INCLUDED
